<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>业务员管理 - 销售业绩管理系统</title>
<style type="text/css">
<!--
.STYLE1 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 12px;
}
.STYLE6 {font-size: 12px; }
.STYLE7 {font-size: 12px; background-color: #f5f5f5;margin:0;}
body { 
margin:0;
}
-->
</style>
</head>

<body margin=0>

<table width="100%" bgcolor="#FFFFFF"  border="0" cellpadding="0" cellspacing="0">
  <tr>
  <input id="ywyid" type="hidden"></input>
    <td height="28" class="STYLE7">业务员管理 &gt;业务员信息修改</td>
  </tr>
  <tr>
    <td valign="top"><table width="100%" align="center" >
      <tr>
        <td height="25" colspan="2" bordercolor="#000000" bgcolor="#1C94C4"><div align="center" class="STYLE1">业务员信息修改</div></td>
      </tr>
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;上级业务员名称：</div>
        </div></td>
		  <td height="25" bgcolor="#F0F0F0"><span class="STYLE6">
		  	<input id="sjywyid" type="hidden"></input>
		    <input id="sjywy" name="textfield3" type="text"  disabled="disabled" value="无" size="15"/> <a href="#" onclick="showUsers()"><input type="submit" name="Submit2" value="选择业务员名称" /></a>
		  </span></td>
	  </tr>
      <tr>
        <td width="32%" height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;业务员名称：</div>
        </div></td>
        <td width="68%" height="22" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="ywy" name="textfield" type="text" value="" />
          </label>
        </span></td>
      </tr>
       <tr>
        <td width="32%" height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;业务员编号：</div>
        </div></td>
        <td width="68%" height="22" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="ywybh" name="textfield" type="text" value="" />
          </label>
        </span></td>
      </tr>
	  <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;位置分布：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><select id="wzfb">
			<option selected="selected">根</option>
          <option >左</option>
          <option>右</option>
        
        </select>
        </td>
	  </tr>
     <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;初始核销左积分：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><input id="zuohxjf" name="textfield2" type="text" value="0" size="10" /></td>
      </tr>
       <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;初始核销右积分：</div>
        </div></td>
        <input type="hidden" id="initzuohxjf"></input>
        <input type="hidden" id="inityouhxjf"></input>
        <input type="hidden" id="leftjf"></input>
        <input type="hidden" id="rightjf"></input>
        <td height="22" bgcolor="#f5f5f5"><input id="youhxjf" name="textfield2" type="text" value="0" size="10" /></td>
      </tr>
      <!-- <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;首30套发放奖金：</div>
         
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><span class="STYLE6">
          <input id="first10" type="checkbox" style="margin-left:20px;" checked="checked"></input>
        </span></td>
      </tr> -->
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;地址：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><input id="address" name="textfield22" type="text"/></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;所属城市：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><select id="cities" name="select">
        </select></td>
      </tr>
	 
      <tr>
        <td height="22" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;联系电话：</div>
        </div></td>
        <td height="22" bgcolor="#f5f5f5"><span class="STYLE6"><input id="telphone" name="textfield2222" type="text"/>
          
        </span> </td>
      </tr>
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;银行卡号：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><input id="banknum" name="banknum" /></td>
      </tr>
      <tr>
        <td height="25" bgcolor="#f5f5f5"><div align="right" class="STYLE6">
          <div align="left">&nbsp;备注：</div>
        </div></td>
        <td height="25" bgcolor="#f5f5f5"><textarea id="bz" name="textarea" rows="5"></textarea></td>
	  </tr>
      <tr>
        <td height="25" colspan="2" bgcolor="#1C94C4"><div align="center" class="STYLE6">
            <form action="" method="post" name="form1" id="form1">
              <label>
              <input type="button" name="Submit" value="修改"  onclick="winalert()"/>
              </label>
            </form>
        </div></td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
	<script language="javascript">
	$.get("../user/fetchcities",{},function(json){
		var opStr = "";
		for(var i = 0,l = json.length ; i < l ; i++)
		{
			opStr += "<option>" + json[i].CityName + "</option>";
		}
		$("#cities").empty().append(opStr);
	});
	
		var url = window.location + "";
		var id = url.substring(url.indexOf("?id=") + 4, url.length);
		$.get("../ywy/ywyinfo", {
			id : id
		}, function(json) {
			$("#ywyid").prop("value", json.ID);
			$("#sjywyid").prop("value", json.UpSalesmanID);
			$("#sjywy").prop("value", json.UpSalesmanName);
			$("#ywy").prop("value", json.SalesmanName);
			$("#ywybh").prop("value", json.SalesmanNumber);
			$("#wzfb").prop("value", json.SalesmanPlace);
			$("#zuohxjf").prop("value", json.InitLeftIntegral);
			$("#youhxjf").prop("value", json.InitRightIntegral);
			$("#address").prop("value", json.SalesmanAddress);
			$("#cities").prop("value", json.SalesmanCity);
			$("#telphone").prop("value", json.Telephone);
			$("#banknum").prop("value", json.BankNum);
			$("#bz").prop("value", json.Description);
			
			$("#initzuohxjf").prop("value", json.InitLeftIntegral);
			$("#inityouhxjf").prop("value", json.InitRightIntegral);
			$("#leftjf").prop("value", json.LeftTotalIntegral);
			$("#rightjf").prop("value", json.RightTotalIntegral);
		});
		function winalert() {
			var ywy = $("#ywy").val();
			var ywybh = $("#ywybh").val();
			var address = $("#address").val();
			var telphone = $("#telphone").val();
			if(ywy == null || ywy == ""){
				alert("请填写业务员姓名！");
				return;
			}
			if(ywybh == null || ywybh == ""){
				alert("请填写业务员编号！");
				return;
			}
			if(address == null || address == ""){
				alert("请填写业务员地址！");
				return;
			}
			if(telphone == null || telphone == ""){
				alert("请填写业务员电话！");
				return;
			}
			$.post("../ywy/edit", {
				ywyid:$("#ywyid").val(),
				sjywyid:$("#sjywyid").val(),
				sjywy:$("#sjywy").val(),
				ywy:$("#ywy").val(),
				ywybh:$("#ywybh").val(),
				wzfb:$("#wzfb").val(),
				zuohxjf:$("#zuohxjf").val(),
				youhxjf:$("#youhxjf").val(),
//				zuohxjf:0,
//				youhxjf:0,
				address:$("#address").val(),
				cities:$("#cities").val(),
				telphone:$("#telphone").val(),
				banknum:$("#banknum").val(),
				//first10:$("#first10").prop("checked"),
				initzuohxjf:$("#initzuohxjf").val(),
				inityouhxjf:$("#inityouhxjf").val(),
				leftjf:$("#leftjf").val(),
				rightjf:$("#rightjf").val(),
				
				initzuohxjf:0,
				inityouhxjf:0,
				leftjf:0,
				rightjf:0,
				
				bz:$("#bz").val()
			}, function(json) {
				if(json)
					{
					alert("更新成功");
					window.returnValue = "1";
					window.close();
					}
			});
		}
		function showUsers(){
			var value = showModalDialog('VerificationUsers.html','选择业务员','dialogWidth:500px;dialogHeight:600px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes'); 
			var ywy = value.split(",");
			$("#sjywyid").prop("value",ywy[0]);
			$("#sjywy").prop("value",ywy[1]);
		}
	</script>
</body>
</html>
